#include <stdio.h>
#include <unistd.h>

int g_val = 10;
int main()
{
  pid_t id = fork();
  if(id == 0)
  {
    g_val = 5;
    printf("我是子进程,g_val的值为:%d,g_val的地址为:%p\n",g_val,&g_val);
  }
  else 
  {
    printf("我是父进程,g_val的值为:%d,g_val的地址为:%p\n",g_val,&g_val);
  }
  return 0;
}
